import { createApp } from 'vue';
import App from './App.vue';
const app = createApp(App);

import 'element-plus/dist/index.css'; /* 必须先加载 */
import '@T2/styles/common.scss';      /* 必须后加载 */
import '@T2/styles/el-common.scss';

import ElementPlus from 'element-plus';
app.use(ElementPlus);
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

import { createPinia } from 'pinia';
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
app.use(pinia);

import router from '@T2/router/index.ts';
app.use(router);

import preventRapidClick from './plugins/preventRapidClick.ts';
app.directive('prevent-rapid-click', preventRapidClick);//使用方法：v-prevent-rapid-click， v-prevent-rapid-click="时间ms"

/* 设置dayjs语言环境 */
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
dayjs.locale('zh-cn');

app.mount("#app");